package de.roskenet.clou.test;

import javax.faces.event.ValueChangeEvent;

public class BackingBean {
	
	private String myString = new String("");
	private int myInt = 2;
	
	public BackingBean() {
		
	}
	
	public String getMyString() {
		
		return myString;
	}
	
	public void setMyString(String myString) {
		
		this.myString = myString;
	}
	
	public int getMyInt() {
		
		return myInt;
	}
	
	public void setMyInt(int myInt) {
		
		this.myInt = myInt;
	}
	
	public void doSomething() {
		System.out.println("\n\nSomething magic happens with:");
		System.out.println("myInt: " + myInt);
		System.out.println("myString: " + myString);
		System.out.println("Processing ends now!\n\n");
		
//		ProcessBuilder pb = new ProcessBuilder("bash /bin/echo \"TEST\" >> /home/felix/temtext.txt");
//		pb.redirectErrorStream(true); // equivalent of 2>&1
//		try {
//		Process p = pb.start();
//		}
//		catch (Exception e) {
//		}
	}
	public void onChange() {
		System.out.println("\n\nSomething happend with the Selection!");
		System.out.println("Deine Auswahl: " + myInt);
		if(myInt == 4) {
			myString = "Jetzt ist Mittwoch!";
		}
	}
	
}
